#include "widget.h"
#include "ui_widget.h"
#include<QPainter>
#include<QPicture>
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

   QPicture picture;
   QPainter p;
   p.begin((&picture));

   p.drawPixmap(0,0,80,80,QPixmap("../Image/face.png"));
   p.drawLine(50,50,150,50);

   p.end();

   picture.save("../picture.png");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::paintEvent(QPaintEvent *)
{
    QPicture pic;
    pic.load("../picture.png");

    QPainter p(this);
    p.drawPicture(0,0,pic);
}
